<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post" enctype="multipart/form-data">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">订单导出</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">区域列表</label>
                                <div class="am-u-sm-9 am-u-end">
                                    <{html_select1("data[area_id][]",$area_list,$info,'区域',1)}>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">分类列表</label>
                                <div class="am-u-sm-9 am-u-end">
                                    <{html_select1("data[cate_id][]",$cate_list,$info,'分类',1)}>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">地点列表</label>
                                <div class="am-u-sm-9 am-u-end">
                                    <{html_select1("data[zone_id][]",$zone_list,$info,'地点',1)}>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">师傅列表</label>
                                <div class="am-u-sm-9 am-u-end">
                                    <select name="data[shifu_id]" multiple 
                                            data-am-selected="{searchBox: 1, btnSize: 'sm'}">
                                        <option value="0">全部师傅</option>
                                        <?php if (isset($shifu_list)): foreach ($shifu_list as $val): ?>
                                            <option value="<?= $val['id'] ?>"
                                                <?= $info['parent_id'] == $val['id'] ? 'selected' : '' ?>
                                                <?= $info['id'] == $val['id'] ? 'disabled' : '' ?>>
                                                <?= $val['realname'] ?></option>
                                        <?php endforeach; endif; ?>
                                    </select>
                                    <div class="help-block">
			                            <small>注：支持多选</small>
			                        </div>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3  am-u-lg-2 am-form-label form-require">开始时间 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <div class="am-form-group tpl-form-border-form am-fl">
                                        <input type="text" name="data[time_s]"
                                                class="am-form-field"
                                                value="<?= $time_s ?>" placeholder="请选择起始日期"
                                                data-am-datepicker>
                                    </div>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3  am-u-lg-2 am-form-label form-require">结束时间 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <div class="am-form-group tpl-form-border-form am-fl">
                                        <input type="text" name="data[time_e]"
                                                class="am-form-field"
                                                value="<?= $time_s ?>" placeholder="请选择结束日期"
                                                data-am-datepicker>
                                    </div>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <!-- <button type="submit" class="j-export am-btn am-btn-secondary">提交
                                    </button> -->
                                    <a class="j-export am-btn am-btn-success am-radius"
                                        href="javascript:void(0);">
                                        <i class="iconfont icon-daochu am-margin-right-xs"></i>订单导出
                                    </a>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {

        /**
         * 文件列表
         */
        $('#doc-form-file').on('change', function () {
            var fileNames = '';
            $.each(this.files, function () {
                fileNames += '<span class="am-badge am-badge-success">' + this.name + '</span> ';
            });
            $('.file-list').html(fileNames);
        });

        /**
         * 表单验证提交
         * @type {*}
         */
        // $('#my-form').superForm();

        /**
         * 订单导出
         */
        $('.j-export').click(function () {
            var data = {};
            var formData = $('#my-form').serializeArray();
            $.each(formData, function () {
                this.name !== 's' && (data[this.name] = this.value);
            });
            window.location = "/<{$routeUrl}>/export_csv" + '?' + $.urlEncode(data);
            // $.post("/<{$routeUrl}>/export", data, function (result) {
            //     // result.code === 1 ? $.show_success(result.msg, result.url)
            //     //     : $.show_error(result.msg);
            // });
        });

    });
</script>
